INPUT = [1 100 250 1000 1999 1
         2 200 250 2000 2999 2
         3 300 250 3000 3999 3
         4 100 250 4000 4999 1
         5 200 250 5000 5999 2
         6 400 250 2204 2800 4];
[sizex,sizey]=size(INPUT);
M = INPUT;
for this_fixation = 1:sizex
id = M(this_fixation,1);
x = M(this_fixation,2);
y = M(this_fixation,3);
onset = M(this_fixation,4);
offset = M(this_fixation,5);
ia = M(this_fixation,6);
end
regression_flag = 0;
for this_fixation=1:sizex-1
this_ia = M(this_fixation,6);
next_ia = M((this_fixation+1),6);
next_fix = 0;
       if next_ia == this_ia+1
         if regression_flag == 0
             next_fix = 1;
             next_fix_code = 'progression to next word';
             elseif regression_flag == 1
             next_fix = 11;
             next_fix_code = 'progression to next word within a regression path';    
         end                         
       elseif next_ia > this_ia+1
         next_fix = 2;
         next_fix_code = 'progression with skip';
       elseif next_ia == this_ia
         next_fix = 3;
         next_fix_code = 'refixation';
       elseif next_ia < this_ia
         next_fix = 4;
         next_fix_code = 'regression';
         regression_flag = 1;
       end
       disp(next_fix_code)
end
